<?php

namespace common\models\hospital;

use Yii;

/**
 * This is the model class for table "{{%expense_header}}".
 *
 * @property int $id
 * @property string|null $hospital 医院简称
 * @property string|null $business_type 业务类型(表头)
 * @property string|null $card_id 卡号(表头)
 * @property string|null $patient_name 患者姓名(表头)
 * @property string|null $doctor_name 医生姓名(表头)
 * @property string|null $section 科室
 * @property string|null $drug 药品名称
 * @property string|null $unit 药品单位
 * @property string|null $count 数量
 * @property string|null $sales_money 销售金额
 * @property string|null $price 售价
 * @property string|null $discounted_money 折后金额
 * @property string|null $buy_money 进价金额
 * @property string|null $difference_money 进销差额
 * @property string|null $money_name 费用名称
 * @property string|null $event_time 发生时间
 * @property string|null $user_name 操作员
 */
class ExpenseHeader extends \common\models\BaseModel
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%expense_header}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['hospital'], 'string', 'max' => 20],
            [['business_type', 'card_id', 'patient_name', 'doctor_name', 'section', 'drug', 'unit', 'count', 'sales_money', 'price', 'discounted_money', 'buy_money', 'difference_money', 'money_name', 'event_time', 'user_name'], 'string', 'max' => 10],
        ];
    }

    public static function getDb()
    {
        return Yii::$app->db3;
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'hospital' => 'Hospital',
            'business_type' => 'Business Type',
            'card_id' => 'Card ID',
            'patient_name' => 'Patient Name',
            'doctor_name' => 'Doctor Name',
            'section' => 'Section',
            'drug' => 'Drug',
            'unit' => 'Unit',
            'count' => 'Count',
            'sales_money' => 'Sales Money',
            'price' => 'Price',
            'discounted_money' => 'Discounted Money',
            'buy_money' => 'Buy Money',
            'difference_money' => 'Difference Money',
            'money_name' => 'Money Name',
            'event_time' => 'Event Time',
            'user_name' => 'User Name',
        ];
    }
}
